﻿using System;
using System.Collections.Generic;

namespace Coogle.Core
{
    public class ShippingType
    {
        private readonly Dictionary<String, String> m_description;
        private readonly String m_typeCode;

        public String Descrition
        {
            get { return m_description[m_typeCode]; }
        }

        public ShippingType(String typeCode)
        {
            m_typeCode = typeCode;
            m_description = new Dictionary<String, String> { { "E", "Exp" }, { "I", "Imp" }, };
        }

        public override string ToString()
        {
            return m_description[m_typeCode];
        }

        public override bool Equals(object obj)
        {
            if (obj == null) return false;
            var ct = obj as ShippingType;
            if (ct == null) return false;
            return m_typeCode.Equals(ct.m_typeCode);
        }

        public override int GetHashCode()
        {
            return m_typeCode.GetHashCode();
        }
    }
}
